<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="" prop="beginTime">
        <el-date-picker clearable
                        v-model="queryParams.beginTime"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="开始日期">
        </el-date-picker>
      </el-form-item>

      <el-form-item prop="endTimee">
        <el-date-picker clearable
                        v-model="queryParams.endTimee"
                        type="date"
                        value-format="yyyy-MM-dd"
                        placeholder="结束日期">
        </el-date-picker>
      </el-form-item>


      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <el-form-item prop="companyName">
        <el-input
          v-model="queryParams.all"
          placeholder="请输入搜索内容"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>

      <el-form-item>
        &nbsp;&nbsp;&nbsp;
        <el-button type="primary" icon="el-icon-search" size="medium" @click="handleQuery">查询</el-button>
        &nbsp;&nbsp;&nbsp;
        <el-button icon="el-icon-refresh" size="medium" @click="resetQuery">重置</el-button>
      </el-form-item>
      &nbsp;&nbsp;&nbsp;
      <el-form-item>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              style="background: #DCDFE6"
              type="primary"
              plain
              icon="el-icon-plus"
              size="medium"
              @click="handleAdd"
              v-hasPermi="['system:station:add']"
            >新增岗位
            </el-button>
          </el-col>
        </el-row>
      </el-form-item>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>

    </el-form>

    <!--    显示页面-->
    <el-table v-loading="loading" :data="stationList" @selection-change="handleSelectionChange"
              style="width: 100%" max-height="100%">
      <el-table-column type="selection" align="center" width="50"/>
      <el-table-column :show-overflow-tooltip="true" label="岗位名称" align="center" prop="stationName" width="110"/>
      <el-table-column label="岗位等级" align="center" prop="jobGrade" width="100"/>
      <el-table-column label="岗位类型" align="center" prop="stationCategory" width="100"/>
      <!--<el-table-column :show-overflow-tooltip="true" label="企业名称" align="center" prop="companyName" width="200"/>
      <el-table-column :show-overflow-tooltip="true" label="项目组" align="center" prop="proName" width="120"/>-->
      <el-table-column label="待初筛" align="center" width="60" prop="cou0">
        <template slot-scope="scope">
          <span v-if="scope.row.cou0 == null">
           0
          </span>
          <span v-if="scope.row.cou0 != null">
           {{ scope.row.cou0 }}
          </span>
        </template>


      </el-table-column>
      <el-table-column label="待面试" align="center" width="60" prop="cou1">
        <template slot-scope="scope">
          <span v-if="scope.row.cou1 == null">
           0
          </span>
          <span v-if="scope.row.cou1 != null">
           {{ scope.row.cou1 }}
          </span>
        </template>

      </el-table-column>
      <el-table-column label="待入职" align="center" width="60" prop="cou2">
        <template slot-scope="scope">
          <span v-if="scope.row.cou2 == null">
           0
          </span>
          <span v-if="scope.row.cou2 != null">
           {{ scope.row.cou2 }}
          </span>
        </template>
      </el-table-column>
      <el-table-column label="待录用" align="center" width="60" prop="cou2">
        <template slot-scope="scope">
          <span v-if="scope.row.cou3 == null">
           0
          </span>
          <span v-if="scope.row.cou3 != null">
           {{ scope.row.cou3 }}
          </span>
        </template>
      </el-table-column>
      <el-table-column label="已入职" align="center" width="60" prop="cou3">
        <template slot-scope="scope">
          <span v-if="scope.row.cou6 == null">
           0
          </span>
          <span v-if="scope.row.cou6 != null">
           {{ scope.row.cou6 }}
          </span>
        </template>
      </el-table-column>
      <el-table-column label="薪资范围" align="center" prop="startMoney" width="100">
        <template slot-scope="scope">
          {{ scope.row.startMoney + '~' + scope.row.endMoney }} K
        </template>
      </el-table-column>

      <el-table-column label="岗位定价(K)" align="center" prop="postPricing" width="100">
        <template slot-scope="scope">
          <span v-if="scope.row.postPricing == null">无</span>
          <span v-if="scope.row.postPricing != null">{{ scope.row.postPricing + 'K' }}</span>
        </template>


      </el-table-column>
      <el-table-column label="负责商务" align="center" prop="createdBy" width="120"/>
      <el-table-column label="招聘人数" align="center" prop="need" width="80"/>
      <el-table-column label="招聘截止" align="center" prop="wokeEndTime" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.wokeEndTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>

      <el-table-column label="岗位创建时间" align="center" prop="createTime" width="130">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="200" align="center" class-name="small-padding fixed-width" fixed="right">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-share"
            @click="playVideo(scope.row.stationId)"
            v-hasPermi="['system:station:query']"
          >岗位详情
          </el-button>

          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleeliminate(scope.row)"
            v-hasPermi="['system:station:eliminate']"
          >停招
          </el-button>
        </template>
      </el-table-column>
    </el-table>


    <!-- 拉取简历对话框 -->
    <el-dialog :title="title" :visible.sync="videoVisibleResume" width="90%" append-to-body>
      <el-form :model="queryResumeParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
               label-width="68px">

        <el-form-item label="" prop="beginTime">
          <el-date-picker clearable
                          v-model="queryResumeParams.beginTime"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="开始日期">
          </el-date-picker>
        </el-form-item>

        <el-form-item prop="endTimee">
          <el-date-picker clearable
                          v-model="queryResumeParams.endTimee"
                          type="date"
                          value-format="yyyy-MM-dd"
                          placeholder="结束日期">
          </el-date-picker>
        </el-form-item>

        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <el-form-item label="人才状态" prop="expectStation" style="width: 300px">
          <el-select v-model="queryResumeParams.status" placeholder="请选择状态">
            <el-option label="全部" value="" @keyup="handleQuery"></el-option>
            <el-option label="已投递" value="1" @keyup="handleQuery"></el-option>
            <el-option label="未投递" value="0" @keyup="handleQuery"></el-option>
            <el-option label="待入职" value="2" @keyup="handleQuery"></el-option>
            <el-option label="已入职" value="3" @keyup="handleQuery"></el-option>
            <el-option label="已离职" value="4" @keyup="handleQuery"></el-option>
          </el-select>
        </el-form-item>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <el-form-item prop="companyName">
          <el-input
            v-model="queryResumeParams.updateTime"
            placeholder="请输入搜索内容"
            clearable
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>


        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="max" @click="handleQueryResume">搜索</el-button>
          <el-button icon="el-icon-refresh" size="max" @click="resetQueryResume">重置</el-button>
        </el-form-item>

      </el-form>


      <!--      简历详情推送-->
      <el-table v-loading="loading" :data="resumeList">
        <el-table-column label="简历姓名" align="center" prop="resumeName"/>
        <el-table-column label="适合岗位" align="center" prop="expectStation"/>
        <el-table-column label="等级" align="center" prop="workyear">

          <template slot-scope="scope">
            <div v-if="scope.row.workyear != null && scope.row.workyear == '1-3年'">
              初级
            </div>
            <div v-else-if="scope.row.workyear != null && scope.row.workyear=='3-5年'">
              中级
            </div>
            <div v-else-if="scope.row.workyear != null && scope.row.workyear=='5-10年'">
              高级
            </div>
            <div v-else-if="scope.row.workyear != null && scope.row.workyear=='10年以上'">
              高级
            </div>
          </template>

        </el-table-column>
        <el-table-column label="电话" align="center" prop="phone"/>
        <el-table-column label="状态" align="center" prop="status">
          <template slot-scope="scope">
          <span v-if="scope.row.status == 0">
            <el-tag type="info">未投递</el-tag>
          </span>
            <span v-if="scope.row.status == 1">
             <el-tag type="primary">已投递</el-tag>
          </span>
            <span v-if="scope.row.status == 2">
             <el-tag type="warning">待入职</el-tag>
          </span>
            <span v-if="scope.row.status == 3">
             <el-tag type="success">已入职</el-tag>
          </span>
            <span v-if="scope.row.status == 4">
             <el-tag type="danger">已离职</el-tag>
          </span>
          </template>
        </el-table-column>

        <el-table-column label="创建时间" align="center" prop="createTime">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
          </template>
        </el-table-column>

        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
          <template slot-scope="scope">

            <el-button
              size="mini"
              type="text"
              icon="el-icon-s-management"
              @click="playVideoB(scope.row.resumeId)"
              v-hasPermi="['system:resume:query']"
            >详情
            </el-button>


            <el-button
              size="mini"
              type="text"
              icon="el-icon-s-promotion"
              @click="addAuits(scope.row.resumeId,scope.row.imgPath)"
              v-hasPermi="['system:auitvo:add']"
            >推送
            </el-button>


          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="total1>0"
        :total="total1"
        :page.sync="queryResumeParams.pageNum"
        :limit.sync="queryResumeParams.pageSize"
        @pagination="getResumeList"
      />

    </el-dialog>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改【请填写功能名称】对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="70%" :close-on-click-modal='false' append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-row :gutter="24">
          <!--<el-col :span="12">
            <el-form-item v-if="showitem" label="招聘企业" prop="companyId">
              <el-select @change="changeProjectTeam" popper-class="page-select-wrapper"
                         v-model="form.companyId" placeholder="请选择" clearable>
                <el-option v-for="item in options"
                           :key="item.companyId" :value="item.companyId" :label="item.companyName">

                </el-option>
                <el-pagination
                  :current-page.sync="enterParam.pageNum"
                  :page-size="enterParam.pageSize"
                  layout="total, prev, pager, next"
                  @current-change="getPages"
                  :total="pages">
                </el-pagination>
              </el-select>
            </el-form-item>
          </el-col>-->
         <!-- <el-col :span="12">
            <el-form-item label="项目组" prop="proId">
              <el-select popper-class="page-select-wrapper"
                         v-model="form.proId" placeholder="请选择" clearable>
                <el-option value="" label="其他"/>
                <el-option v-for="item in projectTeamList"
                           :key="item.id" :value="item.id" :label="item.proName">
                </el-option>
                <el-pagination
                  :current-page.sync="projectTeamParam.pageNum"
                  :page-size="projectTeamParam.pageSize"
                  layout="total, prev, pager, next"
                  @current-change="changeProjectTeam"
                  :total="projectTeamTotal">
                </el-pagination>
              </el-select>
            </el-form-item>
          </el-col>-->
        </el-row>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="岗位名称" prop="stationName">
              <el-input v-model="form.stationName" placeholder="请输入岗位名称"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="岗位类型" prop="stationCategory">
              <el-radio-group v-model="form.stationCategory" size="small">
                <el-radio label="普通岗位">普通岗位</el-radio>
                <el-radio label="经理岗">经理岗</el-radio>
                <el-radio label="分管领导">分管领导</el-radio>
              </el-radio-group>
            </el-form-item>

          </el-col>

          <el-col :span="12">
            <el-form-item label="RPO岗位定价(K)" prop="postPricing" v-if="form.stationCategory == 'RPO岗位'">
              <el-input v-model="form.postPricing" placeholder="请输入定价金额（K）"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="学历要求" prop="education">
              <el-select v-model="form.education" placeholder="请选择学历" style="width: 100%">
                <el-option label="请选择" value=""></el-option>
                <el-option label="不限" value="不限"></el-option>
                <el-option label="专科" value="大专"></el-option>
                <el-option label="本科" value="本科"></el-option>
                <el-option label="硕士" value="硕士"></el-option>
                <el-option label="博士" value="博士"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工作经验" prop="jobGrade">
              <template>
                <el-radio-group v-model="form.jobGrade">
                  <el-radio-button label="初级"></el-radio-button>
                  <el-radio-button label="中级"></el-radio-button>
                  <el-radio-button label="高级"></el-radio-button>
                </el-radio-group>
              </template>
            </el-form-item>

          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="招聘人数" prop="need">
              <el-input-number v-model="form.need" :min="1" :max="999" label="请输入需招人数"></el-input-number>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="用工时长(月)" prop="endTime">
              <el-input-number v-model="form.endTime" :min="1" :max="120" label="请输入需招人数"></el-input-number>
            </el-form-item>
          </el-col>

        </el-row>


        <el-row :gutter="24">
          <el-col :span="12">


            <!--            <span v-if="interview">-->

            <!--            </span>-->
            <!--            <span v-else>-->
            <el-form-item label="最低工资(K)" prop="startMoney">
              <div v-if="checked == false">
                <el-input-number size="small" controls-position="right" v-model="form.startMoney" :min="1"
                                 :max="100"></el-input-number>
                ~
                <el-input-number size="small" controls-position="right" v-model="form.endMoney" :min="1"
                                 :max="100"></el-input-number>
              </div>
              <el-checkbox v-model="checked">面议</el-checkbox>
            </el-form-item>
            <!--            <el-form-item label="最低工资(K)" prop="checked">-->
            <!--              <el-checkbox v-model="checked">面议</el-checkbox>-->
            <!--            </el-form-item>-->
            <!--            </span>-->
            <!--            @click.native="sss()"-->
          </el-col>


          <el-col :span="12">
            <el-form-item label="招聘截止时间" prop="wokeEndTime">
              <el-date-picker clearable
                              style="width: 100%"
                              v-model="form.wokeEndTime"
                              type="date"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择招聘截止时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="12">

            <el-form-item label="省 市 区" prop="wokeAddress" placeholder="请选择省市区" style="width: 780px;">
              <el-col :span="8">
                <el-cascader
                  size="large"
                  :options="optionss"
                  v-model="selectedAddressOptions"
                  @change="handleChange">
                </el-cascader>
              </el-col>
              <el-col :span="4">
                <el-input v-model="form.wokeAddress" placeholder="请输入详细地址" style="width: 300px"/>
              </el-col>
            </el-form-item>
          </el-col>
        </el-row>


        <!--        <el-form-item label="岗位职责" prop="jobDescription">-->
        <!--          <el-input v-model="form.jobDescription" type="textarea" placeholder="请输入岗位职责" autosize/>-->
        <!--        </el-form-item>-->

        <el-form-item label="岗位职责" prop="jobDescription">
          <editor v-model="form.jobDescription" :min-height="192"/>
        </el-form-item>

        <el-form-item label="岗位要求" prop="remarks">
          <editor v-model="form.remarks" :min-height="192"/>
        </el-form-item>

      </el-form>

      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 岗位详情对话框 -->
    <el-dialog :title="title" :visible.sync="videoVisible" width="90%" :close-on-click-modal='false' append-to-body>
      <el-button
        size="mini"
        type="text"
        style="float:left"
        icon="el-icon-edit"
        @click="handleUpdate1"
        v-hasPermi="['system:station:edit']"
      >修改
      </el-button>
<!--      <el-button-->
<!--        size="mini"-->
<!--        type="text"-->
<!--        icon="el-icon-s-promotion"-->
<!--        @click="playVideoF()"-->
<!--      >拉取-->
<!--      </el-button>-->

      <el-descriptions class="margin-top" :column="4" size="medium" border>


        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              岗位名称
            </center>
          </template>
          <center>
            {{ ItoStation.stationName }}
          </center>
        </el-descriptions-item>

       <!-- <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              企业名称
            </center>
          </template>
          <center>
            {{ ItoStation.companyName }}
          </center>
        </el-descriptions-item>-->

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              岗位类别
            </center>
          </template>
          <center>
            {{ ItoStation.stationCategory }}
          </center>
        </el-descriptions-item>


        <!--        <el-form-item label="RPO岗位定价" prop="postPricing" v-if="form.stationCategory == 'RPO岗位'">-->
        <!--          <el-input v-model="form.postPricing" placeholder="请输入定价金额（K）"/>-->
        <!--        </el-form-item>-->

        <el-descriptions-item v-if="form.stationCategory == 'RPO岗位'">
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              RPO岗位定价(K)
            </center>
          </template>
          <center>
            {{ ItoStation.postPricing }}K
          </center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              负责商务
            </center>
          </template>
          <center>{{ ItoStation.createdBy }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              发布日期
            </center>
          </template>
          <center>{{ parseTime(ItoStation.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              学历要求
            </center>
          </template>
          <center>{{ ItoStation.education }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              岗位等级
            </center>
          </template>
          <center>
            {{ ItoStation.jobGrade }}

          </center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              用工时长(月)
            </center>
          </template>
          <center>{{ ItoStation.endTime }}</center>
        </el-descriptions-item>

        <!--        <span v-if="interview==true">-->
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              工资薪酬(K)
            </center>
          </template>
          <center v-if="ItoStation.interview == 0 ">{{ ItoStation.startMoney }}~{{ ItoStation.endMoney }}K</center>
          <center v-if="ItoStation.interview == 1 ">面议</center>

        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              招聘人数
            </center>
          </template>
          <center>{{ ItoStation.need }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              招聘截止日期
            </center>
          </template>
          <center>{{ parseTime(ItoStation.wokeEndTime, '{y}-{m}-{d}') }}</center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              省市区
            </center>
          </template>
          <center>
            {{ ItoStation.province }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              详细地址
            </center>
          </template>
          <center>
            {{ ItoStation.wokeAddress }}
          </center>
        </el-descriptions-item>

       <!-- <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              项目组
            </center>
          </template>
          <center>
            {{ ItoStation.proName }}
          </center>
        </el-descriptions-item>-->
      </el-descriptions>
      <el-descriptions class="margin-top" size="medium" direction="vertical" :column="2" border>

        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            岗位职责
          </template>
          <span v-html="ItoStation.jobDescription"></span>
        </el-descriptions-item>


        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            岗位要求
          </template>
          <span v-html="ItoStation.remarks"></span>
        </el-descriptions-item>
      </el-descriptions>
      <br>
      <span style="padding-left: 20px;font-size: 20px;color:#673ab7;">投递记录</span>&nbsp;&nbsp;
      <el-radio-group v-model="radio1">
        <el-radio-button label="全部" @click.native="aaa('200')"></el-radio-button>
        <el-radio-button label="待初筛" @click.native="aaa(0)"></el-radio-button>
        <el-radio-button label="待面试" @click.native="aaa(1)"></el-radio-button>
        <el-radio-button label="待录用" @click.native="aaa(2)"></el-radio-button>
        <el-radio-button label="待入职" @click.native="aaa(3)"></el-radio-button>
        <el-radio-button label="已入职" @click.native="aaa(6)"></el-radio-button>
      </el-radio-group>
      <el-button type="primary" style="float: right;margin-right: 20px;" @click="downloadAll">批量下载</el-button>
      <br>
      <hr>
      <el-table v-loading="loading" :data="auitvoList"
                ref="multipleTable"
                tooltip-effect="dark"
                style="width: 100%"
                @selection-change="getIds">
        <el-table-column

          align="center"
          type="selection"
          width="55">
        </el-table-column>
        <el-table-column label="状态" align="center" prop="isFirst">
          <template slot-scope="scope">

          <span v-if="scope.row.isFirst == 0">
            <el-tag type="info">待初筛</el-tag>
          </span>
            <span v-if="scope.row.isFirst == 1">
             <el-tag type="primary">待面试</el-tag>
          </span>
            <span v-if="scope.row.isFirst == 2">
             <el-tag type="warning">待录用</el-tag>
          </span>
            <span v-if="scope.row.isFirst == 3">
             <el-tag type="warning">待入职</el-tag>
          </span>
            <span v-if="scope.row.isFirst == 6">
             <el-tag type="danger">已入职</el-tag>
          </span>
          </template>

        </el-table-column>
        <el-table-column label="创建时间" align="center" prop="createTime" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="负责人" align="center" prop="createName"/>
        <el-table-column label="简历名称" align="center" prop="resumeName"/>
        <el-table-column label="简历电话" align="center" prop="phone"/>
        <el-table-column label="岗位名称" align="center" prop="stationName"/>
        <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              @click="download(scope.row.resumeId)"
              v-hasPermi="['system:station:edit']"
            >下载简历
            </el-button>
          </template>
        </el-table-column>

      </el-table>
      <pagination
        v-show="total2>0"
        :total="total2"
        :page.sync="queryParamsAuitvo.pageNum"
        :limit.sync="queryParamsAuitvo.pageSize"
        @pagination="getListAuitvo"
      />

    </el-dialog>

    <!-- 简历详情对话框 -->
    <el-dialog :title="title" :visible.sync="videoVisibleB" width="90%" :close-on-click-modal='false' append-to-body>
      <el-descriptions class="margin-top" :column="5" size="medium" border>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              简历名称
            </center>

          </template>
          <center>
            {{ itoResume.resumeName }}
          </center>

        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              性别
            </center>
          </template>
          <center>
            {{ itoResume.sex }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              年龄
            </center>
          </template>
          <center>
            {{ itoResume.age }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              学历
            </center>
          </template>
          <center>
            {{ itoResume.education }}
          </center>
        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              电话
            </center>
          </template>
          <center>
            {{ itoResume.phone }}
          </center>
        </el-descriptions-item>

        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              工作经验(年限)
            </center>
          </template>
          <center>{{ itoResume.workyear }}</center>

        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center>
              <i class="el-icon-user"></i>
              邮箱
            </center>

          </template>
          <center>{{ itoResume.mailbox }}</center>

        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              期望岗位
            </center>

          </template>
          <center>{{ itoResume.expectStation }}</center>

        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              期望薪资(K)
            </center>

          </template>
          <center>{{ itoResume.expectWage }}</center>

        </el-descriptions-item>
        <el-descriptions-item>
          <template slot="label">
            <center><i class="el-icon-user"></i>
              工作地点
            </center>

          </template>
          <center>{{ itoResume.workplace }}</center>

        </el-descriptions-item>
        <el-descriptions-item :span="1">
          <template slot="label">
            <center><i class="el-icon-user"></i>
              创建时间
            </center>

          </template>
          <center>{{ parseTime(itoResume.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</center>
        </el-descriptions-item>
        <el-descriptions-item :span="1">
          <template slot="label">
            <center><i class="el-icon-user"></i>
              所学专业
            </center>

          </template>
          <center>{{ itoResume.major }}</center>
        </el-descriptions-item>
        <el-descriptions-item :span="1">
          <template slot="label">
            <center><i class="el-icon-user"></i>
              在职状态
            </center>

          </template>
          <center>{{ itoResume.currentState }}</center>
        </el-descriptions-item>
        <el-descriptions-item :span="1">
          <template slot="label">
            <center><i class="el-icon-user"></i>
              初审意见
            </center>

          </template>
          <center>{{ itoResume.opinion }}</center>
        </el-descriptions-item>
      </el-descriptions>
      <el-descriptions class="margin-top" size="medium" direction="vertical" :column="4" border>

        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            专业技能
          </template>
          <span v-html="itoResume.professionalSkill"></span>
        </el-descriptions-item>

        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            工作经历
          </template>
          <span v-html="itoResume.workeUndergo"></span>
        </el-descriptions-item>
        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            项目经验
          </template>
          <span v-html="itoResume.projectUndergo"></span>
        </el-descriptions-item>
        <el-descriptions-item :span="4">
          <template slot="label">
            <i class="el-icon-user"></i>
            教育背景
          </template>
          <span v-html="itoResume.educationalBackground"></span>
        </el-descriptions-item>
      </el-descriptions>
    </el-dialog>

  </div>
</template>

<script>
  import {
    listStation,
    getStation,
    delStation,
    addStation,
    updateStation,
    eliminate,
    getStationResume,
    selectByEnter,
    listResumeStation
  } from "@/api/system/station";
  import {addAuit, getResume, listResume} from "@/api/system/resume";
  import {getProjectTeamList} from "@/api/system/enterprise"
  /*  import { provinceAndCityData, regionData, provinceAndCityDataPlus, regionDataPlus, CodeToText, TextToCode } from 'element-china-area-data'*/
  import {listAuitvo} from "@/api/system/auitvo";
  import {regionData, CodeToText, TextToCode} from 'element-china-area-data'
  import Template from "@/views/system/email/ItoTemplate";


  export default {
    name: "Station",
    components: {Template},
    data() {
      return {
        // postRPO:false,
        isFirst: null,
        showitem: true,
        checked: false,
        ccc: null,
        radio1: '全部',
        resIds: [],
        sId: null,
        //省市区
        optionss: regionData,
        selectedAddressOptions: [],
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        total1: 0,
        total2: 0,
        // 岗位表格数据
        stationList: [],
        // 简历表格数据
        resumeList: [],
        // 【请填写功能名称】表格数据
        auitvoList: [],
        options: [],

        value: null,
        //岗位id
        stationId: null,
        //查询推送表参数
        queryParamsAuitvo: {
          pageNum: 1,
          pageSize: 5,
          isFirst: null,
          stationId: null,
          stationSecond: null,
          resumeName: null,
          phone: null,
          companyName: null,
          stationName: null,
          companyPhone: null,
          companyMailbox: null,
          query: null,
          beginTime: null,
          endTime: null,
          imgPath: null
        },


        // 岗位详情
        ItoStation: {
          stationId: null,
          stationName: null,
          stationCategory: null,
          postPricing: null,
          jobGrade: null,
          experience: null,
          jobDescription: null,
          education: null,
          recruited: null,
          need: null,
          companyName: null,
          province: null,
          wokeAddress: null,
          companyPhone: null,
          companyMailbox: null,
          endTime: null,
          salaryRange: null,
          remarks: null,
          companyWelfare: null,
          createTime: null,
          createdBy: null,
          updateTime: null,
          updatedBy: null,
          wokeEndTime: null,
          startMoney: null,
          endMoney: null,
          status: null,
          interview: null,
          isDelete: null
        },
        // 查询简历参数
        queryResumeParams: {
          pageNum: 1,
          pageSize: 5,
          resumeId: null,
          resumeName: null,
          sex: null,
          age: null,
          imgPath: null,
          education: null,
          phone: null,
          workyear: null,
          mailbox: null,
          expectStation: null,
          expectWage: null,
          workplace: null,
          professionalSkill: null,
          workeUndergo: null,
          projectUndergo: null,
          educationalBackground: null,
          selfEvaluate: null,
          status: null,
          isDelete: 0,
          lowAge: undefined,
          tallAge: undefined,
          lowWage: undefined,
          tallWage: undefined,
          lowWorkyear: undefined,
          tallWorkyear: undefined
        },

        // 查询简历参数2
        itoResume: {
          resumeId: null,
          resumeName: null,
          sex: null,
          age: null,
          imgPath: null,
          education: null,
          phone: null,
          workyear: null,
          mailbox: null,
          expectStation: null,
          expectWage: null,
          workplace: null,
          professionalSkill: null,
          workeUndergo: null,
          projectUndergo: null,
          educationalBackground: null,
          selfEvaluate: null,
          status: null,
          isDelete: 0,

        },

        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        videoVisible: false,
        videoVisibleResume: false,
        videoVisibleB: false,
        videoVisibleResumeStation: false,
        // 查询岗位参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          stationName: null,
          stationCategory: null,
          postPricing: null,
          jobGrade: null,
          experience: null,
          jobDescription: null,
          education: null,
          recruited: null,
          need: null,
          companyName: null,
          province: null,
          wokeAddress: null,
          companyPhone: null,
          companyMailbox: null,
          endTime: null,
          salaryRange: null,
          remarks: null,
          companyWelfare: null,
          createTime: null,
          createdBy: null,
          updateTime: null,
          updatedBy: null,
          wokeEndTime: null,
          startMoney: null,
          endMoney: null,
          beginTime: null,
          endTimee: null,
          status: null,
          cou0: null,
          cou1: null,
          cou2: null,
          cou3: null,
          all: null,
          isDelete: null
        },
        // 表单参数
        form: {},
        // 表单校验
        rules: {
          companyId: [
            {required: true, message: '招聘企业不能为空', trigger: 'change', type: 'number'}
          ],
          stationName: [
            {required: true, message: '岗位名称不能为空', trigger: 'blur'}
          ],
          postPricing: [
            {required: true, message: 'RPO岗位定价不能为空', trigger: 'blur'}
          ],
          education: [
            {required: true, message: '学历要求不能为空', trigger: 'change'}
          ],
          jobGrade: [
            {required: true, message: '工作经验不能为空', trigger: 'change'}
          ],
          need: [
            {required: true, message: '招聘人数不能为空', trigger: 'blur'}
          ],
          endTime: [
            {required: true, message: '用工时长不能为空', trigger: 'blur'}
          ],
          startMoney: [
            {required: true, message: '最低工资、最高工资不能为空', trigger: 'blur'},
          ],
          stationCategory: [
            {required: true, message: '岗位类型不能为空', trigger: 'change'}
          ],
          wokeEndTime: [
            {required: true, message: '招聘截止时间不能为空', trigger: 'change'}
          ],
          wokeAddress: [
            {required: true, message: '省市区、详细地址不能为空', trigger: 'blur'}
          ],
          jobDescription: [
            {required: true, message: '岗位职责不能为空', trigger: 'blur'}
          ],
          remarks: [
            {required: true, message: '岗位要求不能为空', trigger: 'blur'}
          ]
        },
        projectTeamList: [],
        projectTeamParam: {
          pageNum: 1,
          pageSize: 10,
          companyId: undefined
        },
        projectTeamTotal: 0,
        enterParam: {
          pageNum: 1,
          pageSize: 10,
          protectStatus:0,
          status:0,
          isDelete:"0"
        },
        pages:0
      };
    },
    created() {
      this.getList();
    },
    methods: {
      changeProjectTeam() {
        this.projectTeamParam.companyId = this.form.companyId
        getProjectTeamList(this.projectTeamParam).then(res => {
          this.projectTeamList = res.rows
          this.form.proId = ""
          this.projectTeamTotal = res.total
        })
      },
      /*文件下载*/
      download(resumeId) {
        this.$download.zip(resumeId)
      },
      downloadAll() {
        this.$download.zip(this.resIds)
      },
      getIds(val) {
        this.resIds = val.map(item => item.resumeId);
        console.log(this.resIds)
      },
      //省市区
      handleChange(value) {
        //我们选择地址后，selectedAddressOptions 会保存对应的区域码，
        //例如北京的区域码为'110000'
        //我们要取出区域码对应的汉字，就需要用CodeToText(区域码)进行输出
        var name = ''
        this.selectedAddressOptions.map(item => name += CodeToText[item] + '/')
        this.form.province = name;//更新表单的数据，以便保存更新
      },


      /** 查询岗位列表 */
      getList() {
        this.loading = true;
        console.log(this.queryParams)
        listStation(this.queryParams).then(response => {
          console.log(response)
          this.stationList = response.rows;
          this.total = response.total;
        });
        this.loading = false;
      },

      /** 查询 简历 列表 */
      getResumeList() {
        this.loading = true;
        listResumeStation(this.queryResumeParams).then(response => {
          this.resumeList = response.rows;
          this.total1 = response.total;
        });
        this.loading = false;
      },

      /** 查询推送表列表 */
      getListAuitvo() {
        getStationResume(this.queryParamsAuitvo).then(response => {
          this.auitvoList = response.rows;
          this.total2 = response.total;
        });
      },

      /** 查询 状态 列表 */
      // getAuditList() {
      //   this.loading = true;
      //   listResume(this.queryResumeParams).then(response => {
      //     this.resumeList = response.rows;
      //     this.total = response.total;
      //     this.loading = false;
      //   });
      // },


      /** 详情按钮操作 */
      // 点击按钮时,触发弹出效果
      // getStationResume(stationId) {
      //   getStationResume(stationId).then(response => {
      //     this.ItoStation = response.data;
      //     this.videoVisible = true
      //   });
      // },

      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          stationId: null,
          stationName: null,
          stationCategory: null,
          jobGrade: null,
          experience: null,
          jobDescription: null,
          education: null,
          recruited: null,
          need: null,
          companyName: null,
          wokeAddress: null,
          companyPhone: null,
          companyMailbox: null,
          endTime: null,
          salaryRange: null,
          remarks: null,
          companyWelfare: null,
          createTime: null,
          createdBy: null,
          updateTime: null,
          updatedBy: null,
          wokeEndTime: null,
          startMoney: null,
          endMoney: null,
          status: "0",
          isDelete: null,
          proId: ""
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.queryParams = {}
        this.resetForm("queryForm");
        this.handleQuery();
      },

      /** 重置简历按钮操作 */
      resetQueryResume() {
        this.queryResumeParams = {}
        this.resetForm("queryForm");
        this.handleQueryResume();
      },

      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.stationId)
        this.single = selection.length !== 1
        this.multiple = !selection.length
      },


      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.selectedAddressOptions = null;
        this.value = null;
        this.showitem = true;
        // this.postRPO =false;
        this.checked = false;
        selectByEnter(this.enterParam).then(response => {
          this.open = true;
          this.title = "添加岗位"
          this.options = response.rows;
          this.pages = response.total

        });
      },
      getPages() {
        selectByEnter(this.enterParam).then(response => {
          this.options = response.rows;
          this.pages = response.total
        });
      },

      /** 修改按钮操作 */
      handleUpdate(row) {
        this.reset();
        const stationId = row.stationId
        getStation(stationId).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "修改岗位信息";
        });
      },

      /** 详情页修改按钮操作 */
      handleUpdate1() {

        this.reset();
        this.showitem = false
        // this.postRPO =false
        const stationId = this.sId
        getStation(stationId).then(response => {
          if (response.data.interview == '1') {
            this.checked = true;
          }
          if (response.data.interview == '0') {
            this.checked = false;
          }

          this.open = true;
          this.form = response.data;
          this.projectTeamParam.companyId = this.form.companyId
          getProjectTeamList(this.projectTeamParam).then(res => {
            this.projectTeamList = res.rows
          })
          console.log(response.data)
          var addressStr = new Array(); //定义一数组
          addressStr = (this.form.province).split("/"); //字符分割
          this.selectedAddressOptions = TextToCode[addressStr[0]][addressStr[1]][addressStr[2]].code;
          this.title = "修改岗位信息";
          this.getList();
        });
      },
      /** 提交按钮 */
      submitForm() {

        if (this.checked == false) {
          this.form.interview = '0'
        }
        if (this.checked == true) {
          this.form.interview = '1'
        }
        this.$refs["form"].validate(valid => {
          if (valid) {
            this.form.jobDescription = encodeURIComponent(this.form.jobDescription);
            this.form.remarks = encodeURIComponent(this.form.remarks);
            if (this.form.stationId != null) {
              updateStation(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.open = false;
                this.playVideo(this.form.stationId);
                this.getList();
              });
            } else {
              addStation(this.form).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.open = false;
                this.getList();
              });
            }
          }
        });
      },
      /** 删除按钮操作 */
      handleDeletee(row) {
        const stationIds = row.stationId || this.ids;
        this.$modal.confirm('是否确认淘汰该岗位？').then(function () {
          return delStation(stationIds);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("淘汰成功");
        }).catch(() => {
        });
      },

      /** 淘汰按钮操作 */
      handleeliminate(row) {
        const stationIds = row.stationId || this.ids;
        this.$modal.confirm('确定要停招岗位吗？').then(function () {
          return eliminate(stationIds);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("已停招！");
        }).catch(() => {
        });
      },


      /** 详情按钮操作 */
      //点击按钮时,触发弹出效果
      playVideo(stationId) {
        var isFirst = '200';
        this.radio1 = '全部'
        this.sId = stationId;
        this.queryParamsAuitvo.stationId = stationId;
        this.queryParamsAuitvo.isFirst = isFirst
        //触发点击时,让其显示
        getStationResume(this.queryParamsAuitvo).then(response => {
          this.auitvoList = response.rows;
          this.total2 = response.total;
          // this.videoVisibleResumeStation = true
        });
        getStation(stationId).then(response => {
          this.ItoStation = response.data;
          this.videoVisible = true
          this.title = "岗位详情";
        });
      },

      /** 简历列表的推送按钮操作 */
      //点击按钮时,触发弹出效果
      playVideoC(stationId) {
        this.stationId = stationId
        /*点击推送弹出岗位列表时,将简历的文件路径拿了出来*/
        //触发点击时,让其显示
        this.videoVisibleResume = true
        this.getResumeList()
        this.title = "简历详情"
      },
      /** 详情简历列表的推送按钮操作 */
      //点击按钮时,触发弹出效果
      playVideoF() {
        this.queryResumeParams.status = "";
        this.stationId = this.sId
        /*点击推送弹出岗位列表时,将简历的文件路径拿了出来*/
        //触发点击时,让其显示
        this.videoVisibleResume = true
        this.getResumeList()
        this.title = "简历详情"
      },


      /** 简历列表的推送按钮操作 */
      //点击按钮时,触发弹出效果
      playVideoD(stationId) {
        //触发点击时,让其显示
        getStationResume(stationId).then(response => {
          this.auitvoList = response.rows;
          this.videoVisibleResumeStation = true
        });
      },


      /** 简历详情按钮操作 */
      //点击按钮时,触发弹出效果
      playVideoB(resumeId) {
        getResume(resumeId).then(response => {
          this.itoResume = response.data;
          this.videoVisibleB = true
        });
      },


      /** 拉取按钮操作 */
      //点击按钮时,触发弹出效果
      playVideoA() {
        //触发点击时,让其显示
        this.videoVisibleResume = true
        this.getResumeList()
      },

      /** 搜索按钮操作 */
      handleQueryResume() {
        this.queryParams.pageNum = 1;
        this.getResumeList();
      },


      /** 简历推送添加 */
      addAuits(resumeId) {
        var stationId = this.stationId
        addAuit(resumeId, stationId).then(response => {
          this.$modal.msgSuccess("推送成功");
          this.open = false;
          this.getResumeList()
          this.videoVisible = true
        });
      },

      /** 导出按钮操作 */
      handleExport() {
        this.download('system/station/export', {
          ...this.queryParams
        }, `station_${new Date().getTime()}.xlsx`)
      },

      aaa(xxx) {
        /*var stationId = this.sId;
        this.isFirst = xxx;*/
        this.queryParamsAuitvo.isFirst = xxx;
        getStationResume(this.queryParamsAuitvo).then(response => {
          this.auitvoList = response.rows;
          this.total2 = response.total;
        });
      },


      // CategoryHandleChange() {
      //   // this.stationList.stationCategory = "RPO岗位";
      //   var stationCategory = this.stationCategory;
      //
      //   if (stationCategory == 'RPO岗位'){
      //     this.postRPO = true;
      //   }
      //   this.postRPO = false;
      // },

    }
  };
</script>
